package cn.yunbamboos.media.zlm.client.param;

public class AddStreamProxyApiParams extends GenericParams {

    private String vhost = "__defaultVhost__"; //	string	添加的流的虚拟主机，例如__defaultVhost__	Y
    private String app; //	string	添加的流的应用名，例如live	Y
    private String stream; //	string	添加的流的id名，例如test	Y
    private String url; //	string	拉流地址，例如rtmp://live.hkstv.hk.lxdns.com/live/hks2	Y
    private Integer retryCount = 3; //	int	拉流重试次数，默认为-1无限重试	N
    private Integer rtpType = 0; //	int	rtsp拉流时，拉流方式，0：tcp，1：udp，2：组播	N
    private Integer timeoutSec = 120; //	int	拉流超时时间，单位秒，float类型	N
    private Boolean enableHls; //	bool	是否转换成hls-mpegts协议	N
    private Boolean enableHlsFmp4; //	bool	是否转换成hls-fmp4协议	N
    private Boolean enableMp4 = false; //	bool	是否允许mp4录制	N
    private Boolean enableRtsp = true; //	bool	是否转rtsp协议	N
    private Boolean enableRtmp; //	bool	是否转rtmp/flv协议	N
    private Boolean enableTs; //	bool	是否转http-ts/ws-ts协议	N
    private Boolean enableFmp4; //	bool	是否转http-fmp4/ws-fmp4协议	N
    private Boolean hlsDemand; //	bool	该协议是否有人观看才生成	N
    private Boolean rtspDemand; //	bool	该协议是否有人观看才生成	N
    private Boolean rtmpDemand; //	bool	该协议是否有人观看才生成	N
    private Boolean tsDemand; //	bool	该协议是否有人观看才生成	N
    private Boolean fmp4Demand; //	bool	该协议是否有人观看才生成	N
    private Boolean enableAudio; //	bool	转协议时是否开启音频	N
    private Boolean addMuteAudio = true; //	bool	转协议时，无音频是否添加静音aac音频	N
    private String mp4SavePath; //	string	mp4录制文件保存根目录，置空使用默认	N
    private Integer mp4MaxSecond; //	int	mp4录制切片大小，单位秒	N
    private Boolean mp4AsPlayer = false; //	bool	MP4录制是否当作观看者参与播放人数计数	N
    private String hlsSavePath; //	string	hls文件保存保存根目录，置空使用默认	N
    private Integer modifyStamp; //	int	该流是否开启时间戳覆盖(0:绝对时间戳/1:系统时间戳/2:相对时间戳)	N
    // true 不触发事件
    private Boolean autoClose = true; //	bool	无人观看是否自动关闭流(不触发无人观看hook)	N

    @Override
    public void setParams() {
        this.set("vhost", vhost, true)
                .set("app", app, true)
                .set("stream", stream, true)
                .set("url", url, true)
                .set("retry_count", retryCount, false)
                .set("rtpType", rtpType, false)
                .set("timeoutSec", timeoutSec, false)
                .set("enable_hls", enableHls, false)
                .set("enable_hls_fmp4", enableHlsFmp4, false)
                .set("enable_mp4", enableMp4, false)
                .set("enable_rtsp", enableRtsp, false)
                .set("enable_rtmp", enableRtmp, false)
                .set("enable_ts", enableTs, false)
                .set("enable_fmp4", enableFmp4, false)
                .set("hls_demand", hlsDemand, false)
                .set("rtsp_demand", rtspDemand, false)
                .set("rtmp_demand", rtmpDemand, false)
                .set("ts_demand", tsDemand, false)
                .set("fmp4_demand", fmp4Demand, false)
                .set("enable_audio", enableAudio, false)
                .set("add_mute_audio", addMuteAudio, false)
                .set("mp4_save_path", mp4SavePath, false)
                .set("mp4_max_second", mp4MaxSecond, false)
                .set("mp4_as_player", mp4AsPlayer, false)
                .set("hls_save_path", hlsSavePath, false)
                .set("modify_stamp", modifyStamp, false)
                .set("auto_close", autoClose, false)
        ;
    }

    public AddStreamProxyApiParams setVhost(String vhost) {
        this.vhost = vhost;
        return this;
    }

    public AddStreamProxyApiParams setApp(String app) {
        this.app = app;
        return this;
    }

    public AddStreamProxyApiParams setStream(String stream) {
        this.stream = stream;
        return this;
    }

    public AddStreamProxyApiParams setUrl(String url) {
        this.url = url;
        return this;
    }

    public AddStreamProxyApiParams setRetryCount(Integer retryCount) {
        this.retryCount = retryCount;
        return this;
    }

    public AddStreamProxyApiParams setRtpType(Integer rtpType) {
        this.rtpType = rtpType;
        return this;
    }

    public AddStreamProxyApiParams setTimeoutSec(Integer timeoutSec) {
        this.timeoutSec = timeoutSec;
        return this;
    }

    public AddStreamProxyApiParams setEnableHls(Boolean enableHls) {
        this.enableHls = enableHls;
        return this;
    }

    public AddStreamProxyApiParams setEnableHlsFmp4(Boolean enableHlsFmp4) {
        this.enableHlsFmp4 = enableHlsFmp4;
        return this;
    }

    public AddStreamProxyApiParams setEnableMp4(Boolean enableMp4) {
        this.enableMp4 = enableMp4;
        return this;
    }

    public AddStreamProxyApiParams setEnableRtsp(Boolean enableRtsp) {
        this.enableRtsp = enableRtsp;
        return this;
    }

    public AddStreamProxyApiParams setEnableRtmp(Boolean enableRtmp) {
        this.enableRtmp = enableRtmp;
        return this;
    }

    public AddStreamProxyApiParams setEnableTs(Boolean enableTs) {
        this.enableTs = enableTs;
        return this;
    }

    public AddStreamProxyApiParams setEnableFmp4(Boolean enableFmp4) {
        this.enableFmp4 = enableFmp4;
        return this;
    }

    public AddStreamProxyApiParams setHlsDemand(Boolean hlsDemand) {
        this.hlsDemand = hlsDemand;
        return this;
    }

    public AddStreamProxyApiParams setRtspDemand(Boolean rtspDemand) {
        this.rtspDemand = rtspDemand;
        return this;
    }

    public AddStreamProxyApiParams setRtmpDemand(Boolean rtmpDemand) {
        this.rtmpDemand = rtmpDemand;
        return this;
    }

    public AddStreamProxyApiParams setTsDemand(Boolean tsDemand) {
        this.tsDemand = tsDemand;
        return this;
    }

    public AddStreamProxyApiParams setFmp4Demand(Boolean fmp4Demand) {
        this.fmp4Demand = fmp4Demand;
        return this;
    }

    public AddStreamProxyApiParams setEnableAudio(Boolean enableAudio) {
        this.enableAudio = enableAudio;
        return this;
    }

    public AddStreamProxyApiParams setAddMuteAudio(Boolean addMuteAudio) {
        this.addMuteAudio = addMuteAudio;
        return this;
    }

    public AddStreamProxyApiParams setMp4SavePath(String mp4SavePath) {
        this.mp4SavePath = mp4SavePath;
        return this;
    }

    public AddStreamProxyApiParams setMp4MaxSecond(Integer mp4MaxSecond) {
        this.mp4MaxSecond = mp4MaxSecond;
        return this;
    }

    public AddStreamProxyApiParams setMp4AsPlayer(Boolean mp4AsPlayer) {
        this.mp4AsPlayer = mp4AsPlayer;
        return this;
    }

    public AddStreamProxyApiParams setHlsSavePath(String hlsSavePath) {
        this.hlsSavePath = hlsSavePath;
        return this;
    }

    public AddStreamProxyApiParams setModifyStamp(Integer modifyStamp) {
        this.modifyStamp = modifyStamp;
        return this;
    }

    public AddStreamProxyApiParams setAutoClose(Boolean autoClose) {
        this.autoClose = autoClose;
        return this;
    }
}
